home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / mmdf / mmdf-IIb.43 / h / d_proto.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-03-28  |  6.4 KB  |  162 lines

  1.  
  2. /*
  3.  *     message type codes
  4.  */
  5.  
  6. # define  DATA           '0'     /*  data packet  */
  7. # define  DATAACK        '1'     /*  acknowledge DATA packet  */
  8. # define  XPATH          '2'     /*  transmit path packet  */
  9. # define  XPATHACK       '3'     /*  acknowledge XPATH packet  */
  10. # define  RPATH          '4'     /*  receive path packet  */
  11. # define  RPATHACK       '5'     /*  acknowledge RPATH packet  */
  12. # define  ESCAPE         '6'     /*  escape packet  */
  13. # define  ESCAPEACK      '7'     /*  acknowledge ESCAPE packet  */
  14. # define  QUIT           '8'     /*  quit packet  */
  15. # define  QUITACK        '9'     /*  acknowledge QUIT packet  */
  16. # define  NBUFF         'A'     /*  buffering specification packet  */
  17. # define  NBUFFACK     'B'     /*  acknowledge NBUFF pack  */
  18.  
  19.  
  20.  
  21.  
  22. /*
  23.  *     lengths of the fixed length packets
  24.  */
  25.  
  26. # define  LHEADER         6     /*  length of the header on all packets  */
  27.                 /*  If changed, change TEXTOFF also  */
  28. # define  LTERM          2     /*  length of the terminator for all pack  */
  29. # define  LACK            6     /*  length of the ACK packet  */
  30. # define  LRESET         40     /*  length of the RESET packet  */
  31. # define  LRESETACK       6     /*  length of the RESETACK packet  */
  32. # define  LESCAPE         8     /*  length of the ESCAPE packet  */
  33. # define  LNBUFF          8     /*  length of the NBUFF packet  */
  34. # define  LQUIT           6     /*  length of the QUIT packet  */
  35. # define  LQUITACK        6     /*  length of the QUITACK packet  */
  36. # define  LPATH          40     /*  length of an XPATH or RPATH packet  */
  37.  
  38.  
  39.  
  40.  
  41. /*
  42.  *     protocol constants and packet header offsets
  43.  */
  44.  
  45. # define  CHKOFF           0     /*  start of 4 character checksum  */
  46. # define  TYPEOFF          4     /*  type character  */
  47. # define  FLAGOFF          5     /*  flag offset  */
  48. # define  TEXTOFF          6     /*  text offset  */
  49. # define  MAXPOFF          6     /*  maximum packet length field offset  */
  50. # define  ESCOFF           6     /*  escape character field offset  */
  51. # define  NBOFF            6     /*  buffer limit field offset  */
  52. # define  LEGALOFF        10     /*  legal input character set field  */
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59. /*
  60.  *     bits in the flag byte
  61.  */
  62.  
  63. # define  MASTERBIT    010     /*  set of the packet is being sent by the  */
  64.                                /*  host which originated the call          */
  65. # define  EOFBIT        04     /*  set if the last packet in a stream  */
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74. /*
  75.  *     various timeouts
  76.  */
  77.  
  78. # define  CONNWAIT        45     /*  number of seconds to wait for a direct  */
  79.                                  /*  line open to succeed.                   */
  80. # define  DIALWAIT       120     /*  number of seconds to wait for a dial    */
  81.                                  /*  line open to succeed.                   */
  82. # define  ACUWAIT        300     /*  number of seconds to wait for a child   */
  83.                  /*  to succeed opening via the acu     */
  84. # define  XMITWAIT        60     /*  number of seconds to wait for a packet  */
  85.                                  /*  to be transmitted.  this is for the     */
  86.                                  /*  alarm around the port write calls       */
  87. # define  QACKWAIT        10     /*  number of seconds to wait for response  */
  88.                                  /*  to a QUIT packet before retransmission  */
  89. # define  EACKWAIT        10     /*  number of seconds to wait for response  */
  90.                                  /*  to an ESCAPE packet before resending    */
  91. # define  DACKWAIT        10     /*  number of seconds to wait for ACK  */
  92.                                  /*  before retransmission              */
  93. # define  ESCAPEWAIT      60     /*  number of seconds to wait for an  */
  94.                                  /*  ESCAPE packet during protocol     */
  95.                                  /*  startup                           */
  96. # define  NBUFFWAIT       60     /*  number of seconds to wait for NBUFF */
  97. # define  DATAWAIT       180     /*  amount of time to wait for a DATA  */
  98.                                  /*  packet                             */
  99. # define  XPATHWAIT       60     /*  number of seconds to wait for XPATH  */
  100. # define  RPATHWAIT       60     /*  number of seconds to wait for RPATH  */
  101. # define  XPAWAIT         10     /*  number of seconds to wait for XPATHACK  */
  102. # define  RPAWAIT         10     /*  number of seconds to wait for RPATHACK  */
  103. # define  NBACKWAIT       10     /*  number of seconds to wait for NBUFFACK */
  104.  
  105.  
  106.  
  107.  
  108. /*
  109.  *     manifest configuration constants
  110.  */
  111.  
  112. # define  MAXPACKET      255     /*  maximum length of packet excluding  */
  113.                                  /*  <cr>                                */
  114. # define  MINPACKET        6     /*  minimum length of packet excluding  */
  115.                                  /*  <cr>                                */
  116. # define  MINPATHSIZ      40     /*  minimum packet size that a system must   */
  117.                                  /*  be capable of receiving or transmitting  */
  118.                                  /*  excluding <cr>                           */
  119. # define  MAXSCRLINE     256     /*  maximum length of line in script file  */
  120. # define  MAXFIELDS       10     /*  maximum fields on a script line */
  121. # define  MATCHLEN       128     /*  maximum length of string to be matched */
  122.                  /*  in the script file                     */
  123. # define  NSENDTRY         5     /*  number of times to attempt message  */
  124.                                  /*  transmission                        */
  125.  
  126. # define  NBUFFMAX         2     /*  d_nbuff upper limit  */
  127.  
  128.  
  129.  
  130. #ifdef SYS5
  131.  
  132. /* PORT*I is for c_iflag field in termio */
  133. /* PORT*O is for c_oflag field in termio */
  134. /* PORT*C is for c_cflag field in termio */
  135. /* PORT*L is for c_lflag field in termio */
  136.  
  137. # define PORTSONI    (IXON|ICRNL|ISTRIP|IGNBRK|IGNPAR)
  138. # define PORTSONO    (0)
  139. # define PORTSONC    (CS7|PARENB|CREAD|HUPCL)
  140. # define PORTSONL    (0)
  141.  
  142.             /* bits to turn on in script mode */
  143. # define PORTPONI    (IXON|ICRNL|ISTRIP|IGNBRK|IGNPAR)
  144. # define PORTPONO    (0)
  145. # define PORTPONC    (CS7|PARENB|CREAD|HUPCL)
  146. # define PORTPONL    (ICANON)
  147.  
  148. #else
  149.  
  150. # define  PORTSON       (EVENP|ODDP|RAW)
  151.                  /*  bits to turn on in script mode    */
  152. # define  PORTSOFF      (ALLDELAY|CRMOD|ECHO|LCASE)
  153.                  /*  bits to turn off in script mode     */
  154. # define  PORTPON       (EVENP|ODDP)
  155.                  /*  bits to turn on in protocol mode    */
  156. # define  PORTPOFF      (ALLDELAY|CRMOD|ECHO|RAW|LCASE)
  157.                  /*  bits to turn off in protocol mode   */
  158. #endif SYS5
  159.  
  160. #define DELAY_CH '\377'         /* used by d_canon & d_script */
  161. #define BREAK_CH '\376'          /* used by d_canon & d_script */
  162.